[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
IF

    IF is a structured programming command that enables conditional
    processing of commands.  It must terminate with ENDIF.

Syntax

    IF <condition>
       <commands>
    [ELSEIF <condition>]
       <commands>
    [ELSE]
       <commands>
    ENDIF

Argument

    <condition> is a control expression.  If it evaluates to true (.T.),
    all following commands are executed until an ELSEIF, ELSE, or ENDIF is
    encountered.

Options

    Elseif: The ELSEIF clause identifies commands to be executed when
    the <condition> evaluates to true (.T.).  You can specify any number of
    ELSEIF statements within the same IF...ENDIF control structure.

    Else: The ELSE clause identifies commands to be executed when the
    <condition> evaluates to false (.F.).

Usage

    IF <condition> sets up a conditional statement which is a logical
    expression such as (A=B or Numvar<11) for evaluation.  If <condition>
    evaluates to logical True, all subsequent commands are carried out
    until an ELSEIF, ELSE, or ENDIF is reached.  Program control then goes
    to the first command after ENDIF.  If no condition evalutes to true
    (.T.), control passes to the first statement following the ELSE
    statement.

    Note that IF...ENDIF structures may be nested within other IF...ENDIF
    structures and other structured programming commands.  These
    structures, however, must be properly nested.

    Note also that like all Clipper control structures, only the first
    three characters of the END statement are significant.

See Also: DO CASE IF()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson